// Page1.cpp : implementation file
//

#include "stdafx.h"
#include "Resize.h"
#include "Page1.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPage1 property page

IMPLEMENT_DYNCREATE(CPage1, CPropertyPage)

CPage1::CPage1() : CPropertyPage(CPage1::IDD)
{
	//{{AFX_DATA_INIT(CPage1)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

CPage1::~CPage1()
{
}

void CPage1::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPage1)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPage1, CPropertyPage)
	//{{AFX_MSG_MAP(CPage1)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPage1 message handlers

BOOL CPage1::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// Add all controls to be resized

	m_Resizer.Add(this, IDC_NAMELABEL, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT);
	m_Resizer.Add(this, IDC_NAME, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT);

	m_Resizer.Add(this, IDC_FRAME, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT|RESIZE_LOCKBOTTOM);

	m_Resizer.Add(this, IDC_PHONELABEL, RESIZE_LOCKTOP|RESIZE_LOCKLEFT);
	m_Resizer.Add(this, IDC_PHONE, RESIZE_LOCKTOP|RESIZE_LOCKLEFT);

	m_Resizer.Add(this, IDC_FAXLABEL, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT);
	m_Resizer.Add(this, IDC_FAX, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT);
	
	m_Resizer.Add(this, IDC_NOTESLABEL, RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT|RESIZE_LOCKTOP);
	m_Resizer.Add(this, IDC_NOTES, RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT|RESIZE_LOCKBOTTOM|RESIZE_LOCKTOP);

	return TRUE; 
}

void CPage1::OnSize(UINT nType, int cx, int cy) 
{
	CPropertyPage::OnSize(nType, cx, cy);

	// Resize!
	m_Resizer.Resize(this);
	
}
